Constructors have the same
name of the class (thus they are identified to be constructors). They have no
return value. As other methods, they can take arguments. |
|
Constructors have the same
name of the class (thus they are identified to be constructors). They have no
return value. As other methods, they can take arguments. |
|
For example, we may want to
initialize a point to other coordinates than (0, 0). We therefore define a
second constructor taking two integer arguments within the class. |